﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AdminMasterPage.master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<SHDQGSWEB.Models.Gadget>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Index</h2>

    <table>
        <tr>
            <th></th>
            <th>
                GadgetID
            </th>
            <th>
                Name
            </th>
            <th>
                Controller
            </th>
            <th>
                Action
            </th>
            <th>
                ImagePath
            </th>
            <th>
                Title
            </th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%= Html.ActionLink("Edit", "Edit", new { id=item.GadgetID }) %> |
                <%= Html.ActionLink("Details", "Details", new { id=item.GadgetID })%> |
                <%= Html.ActionLink("Delete", "Delete", new { id=item.GadgetID })%>
            </td>
            <td>
                <%= Html.Encode(item.GadgetID) %>
            </td>
            <td>
                <%= Html.Encode(item.Name) %>
            </td>
            <td>
                <%= Html.Encode(item.Controller) %>
            </td>
            <td>
                <%= Html.Encode(item.Action) %>
            </td>
            <td>
                <%= Html.Encode(item.ImagePath) %>
            </td>
            <td>
                <%= Html.Encode(item.Title) %>
            </td>
        </tr>
    
    <% } %>

    </table>

    <p>
        <%= Html.ActionLink("Create New", "Create") %>
    </p>

</asp:Content>

